﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class bonsaiTemp : System.Web.UI.MasterPage
{
    List<string> listProduct;
    List<string> listService;
    protected void Page_Load(object sender, EventArgs e)
    {
        //Menu Product_Left
        listProduct = new List<string>();
        listService = new List<string>();



        ProductTableAdapters.CategoriesTableAdapter pdADT = new ProductTableAdapters.CategoriesTableAdapter();
        ProductTableAdapters.ServiceTableAdapter svADT = new ProductTableAdapters.ServiceTableAdapter();        
        Product pd = new Product();
        pdADT.Fill(pd.Categories);
        svADT.Fill(pd.Service);

        string s = null;
        foreach (DataRow r in pd.Categories.Rows)
        {
            s += ("<li ><a href=\"Product.aspx?categoryID=" + r[0].ToString() + "\">" + r[1].ToString() + "</a></li>");                    
        }
        listPd.InnerHtml = s;

        s = null;
        foreach (DataRow r in pd.Service.Rows)
        {
            s += ("<li ><a href=\"Service.aspx#\">" + r[1].ToString() + "</a></li>");
        }
        listSv.InnerHtml = s;
    }
}
